package com.example.demo.day.config.learn.design.adapter.x2;

import java.util.Map;

public class HttpManger {

    public static final String DIVIDER = ",";
    public static final String CODE_SUCCESS = "0";
    public static final String CODE_FAILED = "1";
    public static final String CODE_ERROR = "-1";

    public void queryUserNameById(Map<String, String> params, OnResponseListener responseListener) {
        if (params == null || params.isEmpty()) {
            responseListener.onError(CODE_ERROR, "参数不能为空");
            return;
        }
        String id = params.get("id");
        if ("1024".equals(id)) {
            responseListener.onResponse(CODE_SUCCESS + DIVIDER + "zhuanghongji");
            return;
        }
        responseListener.onResponse(CODE_FAILED + DIVIDER + "未找到对应用户");
    }

}
